#ifndef NAV_DWB_CONTROLLER_PKG__EXCEPTIONS_HPP_
#define NAV_DWB_CONTROLLER_PKG__EXCEPTIONS_HPP_

#include <stdexcept>
#include <string>
#include <memory>

#include "nav2_core/exceptions.hpp"

namespace nav_dwb_controller_pkg
{

  /**
   * @class PlannerTFException
   * @brief Thrown when the planner cannot complete its operation due to TF errors
   */
  class PlannerTFException : public nav2_core::PlannerException
  {
  public:
    explicit PlannerTFException(const std::string description)
        : nav2_core::PlannerException(description) {}
  };

  /**
   * @class IllegalTrajectoryException
   * @brief Thrown when one of the critics encountered a fatal error
   */
  class IllegalTrajectoryException : public nav2_core::PlannerException
  {
  public:
    IllegalTrajectoryException(const std::string critic_name, const std::string description)
        : nav2_core::PlannerException(description), critic_name_(critic_name) {}
    std::string getCriticName() const { return critic_name_; }

  protected:
    std::string critic_name_;
  };

} // namespace nav_dwb_controller_pkg

#endif // NAV_DWB_CONTROLLER_PKG__EXCEPTIONS_HPP_
